<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--$Id: documentation.html 62 2007-08-02 12:43:28Z iPopovi $-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng">
<head>
	<link rel="stylesheet" type="text/css" href="../my.css" title="webstyle" />
	<title>mod_jail</title>
</head>
<body>
    <h1 id="logo">mod_jail</h1>
 
	<div class="navigation">
	      <a href="index.html">main</a>
	    | <a href="download.html">download</a>
	    | documentation
	    | <a href="changelog.html">changelog</a>
	</div>

	<div class="line"></div>

	<div class="mainbody">
 	<h3><a hRef='download.html'>Current version</a>: 0.4</h3>
	
	<h3>Installation instructions:</h3>
	<h4>From packages:</h4>
	    <code># pkg_add -r mod_jail</code>
	<h4>From ports:</h4>
	    <code># cd /usr/ports/www/mod_jail && make all install clean</code>
	<h4>From source code:</h4>
	    Download source code of mod_jail from <a hRef='download.html'>this page</a>,
	    extract and decompress it <code>tar -xzvf mod_jail-0.4.tar.gz</code>
	<h5>Building mod_jail:</h5>
    	    just type <code>cd mod_jail && make</code>
	<h5>Install mod_jail:</h5>
	    <code>make install</code> (as root)

	<h4>Apache:</h4>	    
	    Edit apache config, you may use httpd.conf.add as example,
	    if you are using apache 1.3 make shure that <code>AddModule mod_jail.so</code>
	    is next line after <code>ClearModuleList</code>,
	    for apache2 <code>LoadModule libexec/apache2/mod_jail2.so</code>
	    is enough.
	    <pre>
LoadModule jail_module        libexec/apache/mod_jail.so
# ...

ClearModuleList
AddModule mod_jail.c
# ...
#
&lt;IfModule mod_jail.c&gt;
        jail_rootdir            "/usr/local/www"
        jail_hostname           "www.localhost.net"
        jail_address            192.168.0.1
        jail_scrlevel           3 # recommended value
&lt;/IfModule&gt;
	    </pre>
	    All parameters must be set.
	<h4>Make it all working:</h4>
	    Just restart apache:
	    <br />
	    <code>apachectl stop; apachectl start</code>
	    <br />
	    So, it should work now.
	    If verion of your FreeBSD is >= 5.1, you can see jail by jls command:
<pre>
# jls
 JID  IP Address      Hostname                      Path
  50  192.168.0.1     www.localhost.net             /usr/local/www
</pre>		   
	    <br />
	    <p>
	    This module is tested to compile and work on FreeBSD 6.0, 6.1 and 6.2.
	    I expect it to work on any FreeBSD &gt; 4.0
	    </p>
	</div>
	<div class="line"></div>
	<div class="copyright">Copyright &copy; 2006-2007
		<a href="mailto:igorpopov@newmail.ru">Igor Popov</a>
	</div>
</body>
</html>
